Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

222
Vistas
404 error when performing "Get" request to API

Trying to perform a "get" request to API. I know the API will return the data when I do the "get" from Postman. So I believe the problem is with my HTML.

<!DOCTYPE html>
<html>
<body>
    <h1>My First Heading</h1>
    <p>My first paragraph.</p>

        <script>
            const Http = new XMLHttpRequest();
            const url='https://localhost:44369';
            Http.open("GET", url);
            Http.send();

            Http.onreadystatechange = (e) => {
            console.log(Http.responseText)
            }

        </script>
</body>
</html>

Here's the API method I'm trying to "get" from:

    //https://localhost:44369/api/Request
    [EnableCors("AllowLocalhostOrigins")]
    [HttpGet]
    public ActionResult GetText()
    {
       string a = "b";

        return Ok(a);
    }

Here's the error I'm getting: 404 Not Found

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

After doing some more reading, I see that it's a problem with the API and not the html code I posted this question about. The html code I posted works fine.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda